package com.ak.game.mapper;

import com.ak.game.entity.PnVipUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

/**
 * vip用户表(PnVipUser)表数据库访问层
 *
 * @author makejava
 * @since 2024-05-17 19:45:50
 */
@Mapper
public interface PnVipUserMapper extends BaseMapper<PnVipUser> {

    @Select("SELECT * FROM pn_vip_user WHERE id = #{id} FOR UPDATE")
    PnVipUser selectByIdForUpdate(@Param("id") String id);

    @Update("UPDATE pn_vip_user SET money = #{money} WHERE id = #{id}")
    int updateMoneyById(@Param("id") String id, @Param("money") BigDecimal money);
}

